<template>
  <a-card :bordered="false">

    <!-- 操作按钮区域 -->


    <!-- table区域-begin -->
    <div>


      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handlePass(record)">通过</a>
          <a-divider type="vertical"/>
          <a @click="handleDetail(record)">点评</a>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <JeecgOrderTicket-modal ref="modalForm" @ok="modalFormOk"></JeecgOrderTicket-modal>
    <JeecgOrderTicket-modal1 ref="modalForm1" @ok="modalFormOk"></JeecgOrderTicket-modal1>
  </a-card>
</template>

<script>
  import JeecgOrderTicketModal from './form/JeecgOrderTicketModal'
  import JeecgOrderTicketModal1 from './form/JeecgOrderTicketModal1'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import {getAction} from '@/api/manage'

  export default {
    name: "JeecgOrderTicketList",
    mixins: [JeecgListMixin],
    components: {
      JeecgOrderTicketModal,
      JeecgOrderTicketModal1
    },
    data() {
      return {
        // 表头
        columns: [{
          title: 'ID',
          align: "center",
          dataIndex: 'outpatientid'
        }, {
          title: '姓名',
          align: "center",
          dataIndex: 'name'
        }, {
          title: '年龄',
          align: "center",
          dataIndex: 'age',
        }, {
          title: '身高',
          align: "center",
          dataIndex: 'height'
        },{
          title: '体重',
          align: "center",
          dataIndex: 'weight'
        },{
          title: '开单诊断',
          align: "center",
          dataIndex: 'diagnosis'
        },{
          title: '首页诊断',
          align: "center",
          dataIndex: 'homepage'
        },{
          title: '感染性疾病科是否会诊',
          align: "center",
          dataIndex: 'check1',
            customRender: (text) => {
              let re = "";
              if (text === true) {
                re = "是";
              } else {
                re = "是";
              }
              return "是";
            }
        }, {
          title: '使用前是否微生物送检',
          align: "center",
          dataIndex: 'check2',
          customRender: (text) => {
            let re = "";
            if (text === true) {
              re = "是";
            } else {
              re = "是";
            }
            return "是";
          }
        }, {
          title: '是否紧急情况下使用',
          align: "center",
          dataIndex: 'check3',
          customRender: (text) => {
            let re = "";
            if (text === true) {
              re = "是";
            } else {
              re = "是";
            }
            return "否";
          }
        }, {
          title: '操作',
          key: 'operation',
          align: "center",
          width: 130,
          scopedSlots: {customRender: 'action'},
        }],
        url: {
          list: "/cro/list",
          delete: "/test/order/deleteTicket",
          deleteBatch: "/test/order/deleteBatchTicket",
        }
      }
    },
    methods: {
      loadData() {
      },
      loadDataList(result) {
        this.dataSource = result;
        //update-end--Author:kangxiaolin  Date:20190905 for：[442]主子表分开维护，生成的代码子表的分页改为真实的分页--------------------
      },
      getOrderMain(orderId) {
        this.queryParam.mainId = orderId;
      },
      handleAdd: function () {
        this.$refs.modalForm.add(this.queryParam.mainId);
        this.$refs.modalForm.title = "添加机票信息";
      },
      handleDetail:function(record){
        if ( parseInt(record.type) === 1) {
          this.$refs.modalForm.edit(record);
          this.$refs.modalForm.title="碳青霉烯";
          this.$refs.modalForm.disableSubmit = true;
        } else {
          this.$refs.modalForm1.edit(record);
          this.$refs.modalForm1.title="替加环素";
          this.$refs.modalForm1.disableSubmit = true;
        }
      },
      handlePass:function(record){
          this.$refs.modalForm1.pass(record);
      },
    }
  }
</script>
<style scoped>
  .ant-card {
    margin-left: -30px;
    margin-right: -30px;
  }
</style>